from PIL import Image


def convert_png_to_srgb(input_path, output_path):
    with Image.open(input_path) as img:
        img = img.convert("RGB")  # Convert to RGB if it's not already
        img.save(output_path, colors=256, palette_type=0)  # Save as 8-bit PNG


# 使用函数转换图片
convert_png_to_srgb("img/小僵尸路障.png", "img/小僵尸路障_1.png")
